import request from '@/utils/request'

export function uploadFile (parameter, config) {
  return request({
    url: '/common/upload',
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    onUploadProgress: config
  })
}

export function uploadAndReturnPng (parameter, config) {
  return request({
    url: '/common/uploadAndReturnPng',
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    onUploadProgress: config,
    timeout: 5 * 60 * 1000
  })
}

export function uploadReturnHash (parameter, config) {
  return request({
    url: '/common/uploadReturnHash',
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    onUploadProgress: config,
    timeout: 5 * 60 * 1000
  })
}

export function apiUploadPdf2Img (parameter, config) {
  return request({
    url: 'common/pdf2Image',
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    onUploadProgress: config
  })
}
export function getAdminMessage (parameter) {
  return request({
    url: '/common/getAdmin',
    method: 'post',
    data: parameter
  })
}
export function sendInvitation (parameter) {
  return request({
    url: '/boss/project/team/invite',
    method: 'post',
    data: parameter
  })
}
export function sendInvitationTeam (parameter) {
  return request({
    url: '/boss/project/team/inviteTeam',
    method: 'post',
    data: parameter
  })
}
export function getOriginationList (parameter) {
  return request({
    url: '/common/listOrgInfo',
    method: 'post',
    data: parameter
  })
}
export function getDepartmentList (parameter) {
  return request({
    url: '/common/listOrgAreaInfo',
    method: 'post',
    data: parameter
  })
}
export function getVerificationCode (parameter) {
  return request({
    url: '/boss/passport/sendCode',
    method: 'post',
    data: parameter
  })
}
export function getEmailCode (parameter) {
  return request({
    url: '/common/send/emailCode',
    method: 'get',
    params: parameter
  })
}
export function sendPhoneCode (parameter) {
  return request({
    url: '/boss/system/user/phone/update',
    method: 'post',
    data: parameter
  })
}
export function sendEmailCode (parameter) {
  return request({
    url: '/boss/system/user/email/update',
    method: 'post',
    data: parameter
  })
}
export function getAdminList (parameter) {
  return request({
    url: '/common/listAdmin',
    method: 'post',
    data: parameter
  })
}

export function countAllFeeApply (parameter) {
  return request({
    url: '/v2/boss/project/apply/countAllFeeApply',
    method: 'get',
    params: parameter
  })
}
export function listRole (parameter) {
  return request({
    url: '/boss/system/role/listRole',
    method: 'post',
    data: parameter
  })
}
export function listOrgDepts (parameter) {
  return request({
    url: '/common/listOrgDepts',
    method: 'post',
    data: parameter
  })
}
export function getMpURLScheme (parameter) {
  return request({
    url: '/common/shareUrl',
    method: 'post',
    data: parameter
  })
}
export function getUserByToken (parameter) {
  return request({
    url: '/boss/passport/getUserByToken',
    method: 'post',
    data: parameter
  })
}

/**
 * 获取项目状态
 * @param parameter
 * @return {*}
 */
export function apiGetProStatus (parameter) {
  return request({
    url: '/common/chekProAndResearchForPts',
    method: 'get',
    params: parameter,
    disableInterceptorNotification: true
  })
}

// 获取系统版本号
export function getSystemVersion () {
  return request({
    url: '/common/getSysVersion',
    method: 'get'
  })
}

// 获取e钱宝url
export function getEsignUrl (parameter) {
  return request({
    url: '/common/getSignUrl',
    method: 'get',
    params: parameter
  })
}

export function mosaicUploadNewForBase64 (parameter) {
  return request({
    url: '/common/mosaicUploadNewForBase64',
    method: 'post',
    data: parameter
  })
}
export function getRepetInfo (parameter) {
  return request({
    url: '/common/getRepetInfo',
    method: 'post',
    data: parameter
  })
}
